//
//  FinanceNavController.m
//  Finance
//
//  Created by cheng xiang on 13-7-5.
//  Copyright (c) 2013年 cheng xiang. All rights reserved.
//

#import "FinanceNavController.h"
#import "NearbyViewController.h"
#import "ProductListViewController.h"
#import "PreviewViewController.h"
#import "AccountViewController.h"
#import "NearbyMotionViewController.h"
@interface FinanceNavController ()

@end

@implementation FinanceNavController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    NSLog(@"test =%d",self.tabBarController.tabBar.selectedItem.tag);
    
    
    if (self.tabBarController.tabBar.selectedItem.tag == 3) {
        NearbyViewController *aController = [[NearbyViewController alloc] init];
        [self setViewControllers:[NSArray arrayWithObject:aController] animated:YES];
    }else if (self.tabBarController.tabBar.selectedItem.tag == 1) {
        ProductListViewController *aController = [[ProductListViewController alloc] init];
        [self setViewControllers:[NSArray arrayWithObject:aController] animated:YES];
    }else if (self.tabBarController.tabBar.selectedItem.tag == 5) {
        PreviewViewController *aController = [[PreviewViewController alloc] init];
        [self setViewControllers:[NSArray arrayWithObject:aController] animated:YES];
    }else if(self.tabBarController.tabBar.selectedItem.tag == 4)
    {
        AccountViewController* account = [[AccountViewController alloc] init];
        [self setViewControllers:[NSArray arrayWithObject:account] animated:YES];
    }else if(self.tabBarController.tabBar.selectedItem.tag == 9)
    {
        NearbyMotionViewController *aController = [[NearbyMotionViewController alloc] init];
        [self setViewControllers:[NSArray arrayWithObject:aController] animated:YES];
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
